#ifndef COMMON_LOG_H
#define COMMON_LOG_H
#include <memory>
#include <spdlog/spdlog.h>
#include <spdlog/fmt/ostr.h>
namespace ShaderLab {
	class Log
	{
	public:
		static void Init();
		static std::shared_ptr<spdlog::logger>& GetLogger() { return s_Logger; }
	private:
		static std::shared_ptr<spdlog::logger> s_Logger;
	};
}

#define LOGTRACE(...)         ShaderLab::Log::GetLogger()->trace(__VA_ARGS__)
#define LOGINFO(...)          ShaderLab::Log::GetLogger()->info(__VA_ARGS__)
#define LOGWARN(...)          ShaderLab::Log::GetLogger()->warn(__VA_ARGS__)
#define LOGERROR(...)         ShaderLab::Log::GetLogger()->error(__VA_ARGS__)
#define LOGCRITICAL(...)      ShaderLab::Log::GetLogger()->critical(__VA_ARGS__)
#define ASSERT(x,...)		 { if(!(x)) { LOGERROR("Assertion Failed: {0}", __VA_ARGS__); __debugbreak(); } }
#endif // !COMMON_LOG_H

